﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    public class GradeConfig
    {
        public Score_threshold score_threshold { get; set; }

        public List<Loss_standardItem> loss_standard { get; set; }

        public List<Alarm_settingItem> alarm_setting { get; set; }

        public List<Warning_settingItem> warning_setting { get; set; }

        public List<Filter_settingItem> filter_setting { get; set; }
    }


    public class Score_threshold
    {
        public int high { get; set; }

        public int low { get; set; }
    }

    public class Range
    {
        public Nullable<double> upper_limit { get; set; }
        public Nullable<double> lower_limit { get; set; }
        public Nullable<int> number_limit { get; set; }
        public Nullable<int> period_length { get; set; }
    }

    public class Loss_standardItem
    {
        public int type { get; set; }
        public int unit { get; set; }
        public Range range { get; set; }
        public double loss { get; set; }
        public double warning_loss { get; set; }
        public double alarm_loss { get; set; }
        public double confidence { get; set; }

    }

    public class Alarm_settingItem
    {
        public int type { get; set; }
        public int unit { get; set; }
        public Range range { get; set; }
    }

    public class Warning_settingItem
    {
        public int type { get; set; }
        public int unit { get; set; }
        public Range range { get; set; }
    }
    public class Filter_settingItem
    {
        public string id { get; set; }
        public string name { get; set; } 
        public int unit { get; set; }
        public Range range { get; set; }
    }

    public class DefectType
    {
        public int id { get; set; }
        public string name { get; set; }

        public string color { get; set; }
        public string icon { get; set; }
        public string shortname { get; set; }

    }
    public class Unit
    {
        public string name { get; set; }
        public string shortname { get; set; }
        public ParmValueType valuetype { get; set; }

    }
    public enum ParmValueType
    {
        UpperLowerValue,
        Number,
        PeriodValue//包含number_limit以及period_length
    }

}
